package com.car.loan.project.xr.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.Collection;
import java.util.List;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.car.loan.project.xr.mapper.CustomerDetailMapper;
import com.car.loan.project.xr.domain.CustomerDetail;
import com.car.loan.project.xr.service.ICustomerDetailService;

/**
 * 客户详情信息Service业务层处理
 *
 * @author ruoyi
 * @date 2019-11-03
 */
@Service
public class CustomerDetailServiceImpl implements ICustomerDetailService {

    @Autowired
    private CustomerDetailMapper customerDetailMapper;

    /**
     * 查询客户详情信息
     *
     * @param id 客户详情信息ID
     * @return 客户详情信息
     */
    @Override
    public CustomerDetail selectCustomerDetailById(Long id) {
        return customerDetailMapper.selectById(id);
    }

    /**
     * 查询客户详情信息列表
     *
     * @param customerDetail 客户详情信息
     * @return 客户详情信息
     */
    @Override
    public List<CustomerDetail> selectCustomerDetailList(CustomerDetail customerDetail) {
        QueryWrapper<CustomerDetail> queryWrapper = new QueryWrapper<>(customerDetail);
        return customerDetailMapper.selectList(queryWrapper);
    }


    @Override
    public IPage<CustomerDetail> selectPage(IPage<CustomerDetail> page,
        QueryWrapper<CustomerDetail> queryWrapper) {
        return customerDetailMapper.selectPage(page, queryWrapper);
    }

    /**
     * 新增客户详情信息
     *
     * @param customerDetail 客户详情信息
     * @return 结果
     */
    @Override
    public int insertCustomerDetail(CustomerDetail customerDetail) {

        return customerDetailMapper.insert(customerDetail);
    }

    /**
     * 修改客户详情信息
     *
     * @param customerDetail 客户详情信息
     * @return 结果
     */
    @Override
    public int updateCustomerDetail(CustomerDetail customerDetail) {

        return customerDetailMapper.updateById(customerDetail);
    }

    /**
     * 删除客户详情信息对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteCustomerDetailByIds(Collection<Long> ids) {
        return customerDetailMapper.deleteBatchIds(ids);
    }

    /**
     * 删除客户详情信息信息
     *
     * @param id 客户详情信息ID
     * @return 结果
     */
    @Override
    public int deleteCustomerDetailById(Long id) {
        return customerDetailMapper.deleteById(id);
    }
}
